<?
require_once("base/BaseAbstractListForm.php");

class AbstractListForm extends BaseAbstractListForm {

    const ORDER_ASCENDING = "asc";
    const ORDER_DESCENDING = "desc";

    public function __construct() {
        parent::__construct();
    }

    public function getCount() {
        return $this->getPage() * $this->getResults();
    }

    public function reset() {
        $this->setAction(null);
        $this->setItems(array());
    }

    public function validate() {

        $errors = parent::validate();

        if(count($this->items) == 0 && strlen($this->action) > 0)
            $errors->add(ActionMessage::GLOBAL_MESSAGE,
                new ActionMessage("list.error.required.items", true));

        return $errors;
    }

}
?>